﻿@model MilageMVC.Models.Mileage

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Mileage</legend>

        <div class="row">
            <span class="span2">You Drove</span> @Html.TextBoxFor(model => model.Distance, new { style = "width:50px"  })

            @Html.ValidationMessageFor(model => model.Distance)
            @Html.DropDownListFor(model => model.DistanceType.Id,
                        new SelectList(ViewBag.DistanceTypes, "Id", "Name"))
        </div>

        <div class="row">
            <span class="span2">And filled up on:</span>
            @Html.EditorFor(model => model.DateEntered)
            @Html.ValidationMessageFor(model => model.DateEntered)
        </div>


        <div class="row">
            <span class="span2">by pumping</span>            @Html.TextBoxFor(model => model.VolumeAmount, new { style = "width:50px" })
            @Html.ValidationMessageFor(model => model.VolumeAmount)

            
                @Html.ValidationMessageFor(model => model.VolumeUnits)
                @Html.DropDownListFor(model => model.VolumeUnits.Id,
                        new SelectList(ViewBag.VolumeUnits, "Id", "Name")) <span  > of Gasoline </span>
            

        </div>

        <p>
            <input type="submit" value="Add Mileage" class="btn btn-primary" />
        </p>
    </fieldset>
    
    @Html.Hidden("VehicleId", (int)TempData["VehicleId"]);
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
